package com.yscp.ysdemo.mq;

import com.yscp.ysdemo.constant.MqConstants;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public final class MqWorkSender {



    private MqWorkSender(){};

    @Resource
    private RabbitTemplate rabbitTemplate;


    public void WorkerMsgSend(String key,Object msg){
        rabbitTemplate.convertAndSend(MqConstants.EXCHANGE_OPTION_KEY,key,msg);
    }
}
